package com.beiing.tianshuai.tianshuai.itemtouch;

import android.support.v7.widget.helper.TinsineItemTouchHelper;

/**
 * Created by Jinni on 2017/11/2 0002
 */

public class DefaultItemTouchHelper extends TinsineItemTouchHelper {

    private final DefaultItemTouchHelperCallback mItemTouchHelperCallback;

    public DefaultItemTouchHelper(DefaultItemTouchHelperCallback.OnItemTouchCallbackListener onItemTouchCallbackListener) {
        super(new DefaultItemTouchHelperCallback(onItemTouchCallbackListener));
        mItemTouchHelperCallback = (DefaultItemTouchHelperCallback) getCallback();
    }

    /**
     * 设置是否可以被拖拽
     *
     * @param canDrag 是true，否false
     */
    public void setDragEnable(boolean canDrag) {
        mItemTouchHelperCallback.setDragEnable(canDrag);
    }

    /**
     * 设置是否可以被滑动
     *
     * @param canSwipe 是true，否false
     */
    public void setSwipeEnable(boolean canSwipe) {
        mItemTouchHelperCallback.setSwipeEnable(canSwipe);
    }
}
